const KEY = 'my-token-sunlead-logistcs'
const TimeKey = 'time-tianme-expire'
const TimeOut = 'expire-time-out'
const MenuLi = 'expire-menu-list'
const User = 'expire-user'
export const getToken = () => {
  return localStorage.getItem(KEY)
}

export const setToken = (token) => {
  localStorage.setItem(KEY, token)
}

export const removeToken = () => {
  localStorage.removeItem(KEY)
}

export const setTime = () => {
  localStorage.setItem(TimeKey, Date.now())
}

export const getTime = () => {
  localStorage.getItem(TimeKey)
}

export const setExpire = (expire) => {
  localStorage.setItem(TimeOut, expire)
}
export const getExpire = () => {
  localStorage.getItem(TimeOut)
}

export const getMenu = () => {
  JSON.parse(localStorage.getItem(MenuLi))
}

export const setMenu = (menu) => {
  localStorage.setItem(MenuLi, JSON.stringify(menu))
}

export const getUser = () => {
  JSON.parse(localStorage.getItem(User))
}

export const setUser = (info) => {
  localStorage.setItem(User, JSON.stringify(info))
}
